]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/entry: Fix leak when copying or cutting text using shortcuts
authorSebastian Keller <skeller@gnome.org>
Sun, 7 Jun 2020 22:42:00 +0000 (00:42 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 8 Jun 2020 15:21:17 +0000 (15:21 +0000)
clutter_text_get_selection() creates a copy of the selected text which
gets passed to st_clipboard_set_text() which creates its own copy. The
copy returned by clutter_text_get_selection() however never got free'd.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1306

src/st/st-entry.c

index c946ca0f9d9c9d926abd88781ecb66f6d0d46100..10dfe1dd167f99b65f4b575c9da95b2c2dacdcee 100644 (file)
@@ -678,6 +678,8 @@ st_entry_key_press_event (ClutterActor    *actor,
                                ST_CLIPBOARD_TYPE_CLIPBOARD,
                                text);
 
+      g_free (text);
+
       return TRUE;
     }
 
@@ -704,6 +706,8 @@ st_entry_key_press_event (ClutterActor    *actor,
           clutter_text_delete_selection ((ClutterText *) priv->entry);
         }
 
+      g_free (text);
+
       return TRUE;
     }